package com.xhm.bbs.web.api;

import com.xhm.bbs.pojo.dto.UserAddDTO;
import com.xhm.bbs.pojo.dto.UserUpdateDTO;
import com.xhm.bbs.pojo.qo.UserQO;
import com.xhm.bbs.pojo.vo.UserListVO;
import com.xhm.bbs.pojo.vo.UserShowVO;
import com.xhm.common.pojo.qo.OptionQO;
import com.xhm.common.pojo.vo.OptionVO;
import com.xhm.common.pojo.vo.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;

import java.util.List;

/**
 * 【用户】API
 * <p>swagger接口文档
 *
 * @author mrj
 * @date 2020/01/01
 */
@Api(tags = "【用户】API")
public interface UserAPI {

    /**
     * 新增【用户】
     */
    @ApiOperation(value="新增【用户】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "userAddDTO", dataType = "UserAddDTO", value = "新增【用户】参数", paramType = "body"),
    })
    ResponseEntity<UserShowVO> save(UserAddDTO userAddDTO) throws Exception;

    /**
     * 修改【用户】
     */
    @ApiOperation(value="修改【用户】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "userUpdateDTO", dataType = "UserUpdateDTO", value = "修改【用户】参数", paramType = "body"),
    })
    ResponseEntity<UserShowVO> update(UserUpdateDTO userUpdateDTO);

    /**
     * 分页查询【用户】
     */
    @ApiOperation(value="分页查询【用户】")
    ResponseEntity<PageVO<UserListVO>> list(UserQO userQO);

    /**
     * 查询【用户】选项列表
     */
    @ApiOperation(value = "查询【用户】选项列表")
    ResponseEntity<List<OptionVO<Integer, String>>> findOptions(OptionQO<Integer, String> qo);

    /**
     * 查看【用户】详情
     */
    @ApiOperation(value="查看【用户】详情")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", dataType = "int", value = "【用户】id", paramType = "path"),
    })
    ResponseEntity<UserShowVO> show(Integer id);

    /**
     * 删除单个【用户】
     */
    @ApiOperation(value="删除单个【用户】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", dataType = "int", value = "【用户】id", paramType = "path"),
    })
    ResponseEntity<Integer> delete(Integer id);

    /**
     * 批量删除【用户】
     */
    @ApiOperation(value = "批量删除【用户】")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", dataType = "int", value = "id数组", paramType = "body"),
    })
    ResponseEntity<Integer> deleteBatch(Integer[] id);


}

